package com.vaadin.thomas.contenttool.demo;

import java.util.HashSet;
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Logger;

import com.vaadin.thomas.contenttool.Config;
import com.vaadin.thomas.contenttool.data.Model;
import com.vaadin.thomas.contenttool.data.impl.ModelImpl;

final class SimpleConfig implements Config {

	static final String DB_LOCATION = "location";

	@Override
	public Set<Locale> getAllowedLanguages() {
		Set<Locale> s = new HashSet<Locale>();

		s.add(new Locale("en"));
		s.add(new Locale("fi"));
		return s;
	}

	@Override
	public String getAppURL() {
		return AdminApplication.getAppURL();
	}

	@Override
	public boolean allowTimedPublishing() {
		return true;
	}

	@Override
	public boolean allowTags() {
		return true;
	}

	@Override
	public boolean debug() {
		return false;
	}

	@Override
	public boolean allowLogging() {
		return true;
	}

	@Override
	public String getUserNameForAdminUI(String id) {
		return "Thomas";
	}

	@Override
	public String getUserIdToStore() {
		return "1234";
	}

	@Override
	public boolean showContentToolIdentifiers() {
		return false;
	}

	@Override
	public Logger logger() {
		return null;
	}

	@Override
	public boolean throwWhenValueNotFound() {
		return false;
	}

	@Override
	public boolean autoCreateDataStoreIfNotFound() {
		return true;
	}

	@Override
	public boolean bootstrapUIValues() {
		return true;
	}

	@Override
	public String getModelId() {
		return null;
	}

	@Override
	public Class<? extends Model> getModelClass() {
		return ModelImpl.class;
	}

	@Override
	public Properties getStorageProperties() {
		Properties props = new Properties();
		props.setProperty(DB_LOCATION, "D:\\WORK\\ContentTool\\db");
		// props.setProperty("location", "/home/dev/tmp/");
		return props;
	}
}